forum

home / developersection / forums / use of undeclared identifier “sum”

Use of undeclared identifier “sum”

Anonymous User 2875 04-Aug-2015

I have repeated error 3rd time, but I could not found that what is mean of use of undeclared identifier ..

I wrote that program on function in objective-C

#import <Foundation/Foundation.h>

 

@interface Add:NSObject

 

/* method declaration */  - (int)add:(int)a andNum2:(int)b;

@end

@implementation Add

 

/* method returning the max between two numbers */  - (int)add:(int)a andNum2:(int)b {

/* local variable declaration */

int sum = a +b;

return sum;

}

@end

NSLog(@"sum is : %d", sum);// error this line    

  return 0;

}


Updated on 05-Aug-2015

I am a content writter !


Message
Can you answer this question?

Answer

1 Answers

Liked By